package com.hu.controller;


import com.hu.bookstorecommon.entity.user;
import com.hu.service.userService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class userController {
   @Autowired
   private userService userService;
   @GetMapping("/users")
    public user login(String username){
      // System.out.println(username);
        return  userService.login(username);
    }

   @PostMapping("users")

   private  Integer userRegister(@RequestBody user user){
       System.out.println(user);

       return userService.userRegister(user);

   }




}
